import { IPSAppModule } from '../ipsapp-module';
import { IPSApplication } from '../ipsapplication';
import { IPSAppPortletCat } from '../control/ipsapp-portlet-cat';
import { IPSAppDEACMode } from './ipsapp-deacmode';
import { IPSAppDEAction } from './ipsapp-deaction';
import { IPSAppDEDataExport } from './ipsapp-dedata-export';
import { IPSAppDEDataImport } from './ipsapp-dedata-import';
import { IPSAppDEDataSet } from './ipsapp-dedata-set';
import { IPSAppDEField } from './ipsapp-defield';
import { IPSAppDELogic } from './ipsapp-delogic';
import { IPSAppDEMethod } from './ipsapp-demethod';
import { IPSAppDEMethodDTO } from './ipsapp-demethod-dto';
import { IPSAppDEPrint } from './ipsapp-deprint';
import { IPSAppDERS } from './ipsapp-ders';
import { IPSAppDEUIAction } from './ipsapp-deuiaction';
import { IPSAppDEUILogic } from './ipsapp-deuilogic';
import { IPSAppDataEntity } from './ipsapp-data-entity';
import { IPSAppView } from '../view/ipsapp-view';
import { IPSDataEntity } from '../../dataentity/ipsdata-entity';
import { IPSDER1N } from '../../dataentity/der/ipsder1-n';
import { IPSDEMainState } from '../../dataentity/mainstate/ipsdemain-state';
import { IPSDEOPPriv } from '../../dataentity/priv/ipsdeoppriv';
import { IPSDEServiceAPI } from '../../dataentity/service/ipsdeservice-api';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';
import { IPSSysSFPlugin } from '../../res/ipssys-sfplugin';
import { IPSSysServiceAPI } from '../../service/ipssys-service-api';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSAppDataEntityImpl extends PSModelObjectImpl implements IPSAppDataEntity {
  protected allpsappdeacmodes: IPSAppDEACMode[] | null = null;

  getAllPSAppDEACModes(): IPSAppDEACMode[] | null {
    if (this.allpsappdeacmodes == null) {
      this.allpsappdeacmodes = this.fillChildListModel(this.M.getAllPSAppDEACModes, 'app.dataentity.IPSAppDEACMode') as IPSAppDEACMode[];
    }
    return this.allpsappdeacmodes;
  }

  get allPSAppDEACModes(): IPSAppDEACMode[] | null {
    return this.getAllPSAppDEACModes();
  }

  findPSAppDEACMode(objKey: any): IPSAppDEACMode | null {
    return this.getPSModel5('app.dataentity.IPSAppDEACMode', this.getAllPSAppDEACModes(), objKey) as IPSAppDEACMode;
  }

  protected allpsappdeactions: IPSAppDEAction[] | null = null;

  getAllPSAppDEActions(): IPSAppDEAction[] | null {
    if (this.allpsappdeactions == null) {
      this.allpsappdeactions = this.fillChildListModel(this.M.getAllPSAppDEActions, 'app.dataentity.IPSAppDEAction') as IPSAppDEAction[];
    }
    return this.allpsappdeactions;
  }

  get allPSAppDEActions(): IPSAppDEAction[] | null {
    return this.getAllPSAppDEActions();
  }

  findPSAppDEAction(objKey: any): IPSAppDEAction | null {
    return this.getPSModel5('app.dataentity.IPSAppDEAction', this.getAllPSAppDEActions(), objKey) as IPSAppDEAction;
  }

  protected allpsappdedataexports: IPSAppDEDataExport[] | null = null;

  getAllPSAppDEDataExports(): IPSAppDEDataExport[] | null {
    if (this.allpsappdedataexports == null) {
      this.allpsappdedataexports = this.fillChildListModel(this.M.getAllPSAppDEDataExports, 'app.dataentity.IPSAppDEDataExport') as IPSAppDEDataExport[];
    }
    return this.allpsappdedataexports;
  }

  get allPSAppDEDataExports(): IPSAppDEDataExport[] | null {
    return this.getAllPSAppDEDataExports();
  }

  findPSAppDEDataExport(objKey: any): IPSAppDEDataExport | null {
    return this.getPSModel5('app.dataentity.IPSAppDEDataExport', this.getAllPSAppDEDataExports(), objKey) as IPSAppDEDataExport;
  }

  protected allpsappdedataimports: IPSAppDEDataImport[] | null = null;

  getAllPSAppDEDataImports(): IPSAppDEDataImport[] | null {
    if (this.allpsappdedataimports == null) {
      this.allpsappdedataimports = this.fillChildListModel(this.M.getAllPSAppDEDataImports, 'app.dataentity.IPSAppDEDataImport') as IPSAppDEDataImport[];
    }
    return this.allpsappdedataimports;
  }

  get allPSAppDEDataImports(): IPSAppDEDataImport[] | null {
    return this.getAllPSAppDEDataImports();
  }

  findPSAppDEDataImport(objKey: any): IPSAppDEDataImport | null {
    return this.getPSModel5('app.dataentity.IPSAppDEDataImport', this.getAllPSAppDEDataImports(), objKey) as IPSAppDEDataImport;
  }

  protected allpsappdedatasets: IPSAppDEDataSet[] | null = null;

  getAllPSAppDEDataSets(): IPSAppDEDataSet[] | null {
    if (this.allpsappdedatasets == null) {
      this.allpsappdedatasets = this.fillChildListModel(this.M.getAllPSAppDEDataSets, 'app.dataentity.IPSAppDEDataSet') as IPSAppDEDataSet[];
    }
    return this.allpsappdedatasets;
  }

  get allPSAppDEDataSets(): IPSAppDEDataSet[] | null {
    return this.getAllPSAppDEDataSets();
  }

  findPSAppDEDataSet(objKey: any): IPSAppDEDataSet | null {
    return this.getPSModel5('app.dataentity.IPSAppDEDataSet', this.getAllPSAppDEDataSets(), objKey) as IPSAppDEDataSet;
  }

  protected allpsappdefields: IPSAppDEField[] | null = null;

  getAllPSAppDEFields(): IPSAppDEField[] | null {
    if (this.allpsappdefields == null) {
      this.allpsappdefields = this.fillChildListModel(this.M.getAllPSAppDEFields, 'app.dataentity.IPSAppDEField') as IPSAppDEField[];
    }
    return this.allpsappdefields;
  }

  get allPSAppDEFields(): IPSAppDEField[] | null {
    return this.getAllPSAppDEFields();
  }

  findPSAppDEField(objKey: any): IPSAppDEField | null {
    return this.getPSModel5('app.dataentity.IPSAppDEField', this.getAllPSAppDEFields(), objKey) as IPSAppDEField;
  }

  protected allpsappdelogics: IPSAppDELogic[] | null = null;

  getAllPSAppDELogics(): IPSAppDELogic[] | null {
    if (this.allpsappdelogics == null) {
      this.allpsappdelogics = this.fillChildListModel(this.M.getAllPSAppDELogics, 'app.dataentity.IPSAppDELogic') as IPSAppDELogic[];
    }
    return this.allpsappdelogics;
  }

  get allPSAppDELogics(): IPSAppDELogic[] | null {
    return this.getAllPSAppDELogics();
  }

  findPSAppDELogic(objKey: any): IPSAppDELogic | null {
    return this.getPSModel5('app.dataentity.IPSAppDELogic', this.getAllPSAppDELogics(), objKey) as IPSAppDELogic;
  }

  protected allpsappdemethoddtos: IPSAppDEMethodDTO[] | null = null;

  getAllPSAppDEMethodDTOs(): IPSAppDEMethodDTO[] | null {
    if (this.allpsappdemethoddtos == null) {
      this.allpsappdemethoddtos = this.fillChildListModel(this.M.getAllPSAppDEMethodDTOs, 'app.dataentity.IPSAppDEMethodDTO') as IPSAppDEMethodDTO[];
    }
    return this.allpsappdemethoddtos;
  }

  get allPSAppDEMethodDTOs(): IPSAppDEMethodDTO[] | null {
    return this.getAllPSAppDEMethodDTOs();
  }

  findPSAppDEMethodDTO(objKey: any): IPSAppDEMethodDTO | null {
    return this.getPSModel5('app.dataentity.IPSAppDEMethodDTO', this.getAllPSAppDEMethodDTOs(), objKey) as IPSAppDEMethodDTO;
  }

  protected allpsappdemethods: IPSAppDEMethod[] | null = null;

  getAllPSAppDEMethods(): IPSAppDEMethod[] | null {
    if (this.allpsappdemethods == null) {
      this.allpsappdemethods = this.fillChildListModel(this.M.getAllPSAppDEMethods, 'app.dataentity.IPSAppDEMethod') as IPSAppDEMethod[];
    }
    return this.allpsappdemethods;
  }

  get allPSAppDEMethods(): IPSAppDEMethod[] | null {
    return this.getAllPSAppDEMethods();
  }

  findPSAppDEMethod(objKey: any): IPSAppDEMethod | null {
    return this.getPSModel5('app.dataentity.IPSAppDEMethod', this.getAllPSAppDEMethods(), objKey) as IPSAppDEMethod;
  }

  protected allpsappdeprints: IPSAppDEPrint[] | null = null;

  getAllPSAppDEPrints(): IPSAppDEPrint[] | null {
    if (this.allpsappdeprints == null) {
      this.allpsappdeprints = this.fillChildListModel(this.M.getAllPSAppDEPrints, 'app.dataentity.IPSAppDEPrint') as IPSAppDEPrint[];
    }
    return this.allpsappdeprints;
  }

  get allPSAppDEPrints(): IPSAppDEPrint[] | null {
    return this.getAllPSAppDEPrints();
  }

  findPSAppDEPrint(objKey: any): IPSAppDEPrint | null {
    return this.getPSModel5('app.dataentity.IPSAppDEPrint', this.getAllPSAppDEPrints(), objKey) as IPSAppDEPrint;
  }

  protected allpsappdeuiactions: IPSAppDEUIAction[] | null = null;

  getAllPSAppDEUIActions(): IPSAppDEUIAction[] | null {
    if (this.allpsappdeuiactions == null) {
      this.allpsappdeuiactions = this.fillChildListModel(this.M.getAllPSAppDEUIActions, 'app.dataentity.IPSAppDEUIAction') as IPSAppDEUIAction[];
    }
    return this.allpsappdeuiactions;
  }

  get allPSAppDEUIActions(): IPSAppDEUIAction[] | null {
    return this.getAllPSAppDEUIActions();
  }

  findPSAppDEUIAction(objKey: any): IPSAppDEUIAction | null {
    return this.getPSModel5('app.dataentity.IPSAppDEUIAction', this.getAllPSAppDEUIActions(), objKey) as IPSAppDEUIAction;
  }

  protected allpsappdeuilogics: IPSAppDEUILogic[] | null = null;

  getAllPSAppDEUILogics(): IPSAppDEUILogic[] | null {
    if (this.allpsappdeuilogics == null) {
      this.allpsappdeuilogics = this.fillChildListModel(this.M.getAllPSAppDEUILogics, 'app.dataentity.IPSAppDEUILogic') as IPSAppDEUILogic[];
    }
    return this.allpsappdeuilogics;
  }

  get allPSAppDEUILogics(): IPSAppDEUILogic[] | null {
    return this.getAllPSAppDEUILogics();
  }

  findPSAppDEUILogic(objKey: any): IPSAppDEUILogic | null {
    return this.getPSModel5('app.dataentity.IPSAppDEUILogic', this.getAllPSAppDEUILogics(), objKey) as IPSAppDEUILogic;
  }

  protected allpsappportletcats: IPSAppPortletCat[] | null = null;

  getAllPSAppPortletCats(): IPSAppPortletCat[] | null {
    if (this.allpsappportletcats == null) {
      this.allpsappportletcats = this.fillChildListModel(this.M.getAllPSAppPortletCats, 'app.control.IPSAppPortletCat') as IPSAppPortletCat[];
    }
    return this.allpsappportletcats;
  }

  get allPSAppPortletCats(): IPSAppPortletCat[] | null {
    return this.getAllPSAppPortletCats();
  }

  findPSAppPortletCat(objKey: any): IPSAppPortletCat | null {
    return this.getPSModel5('app.control.IPSAppPortletCat', this.getAllPSAppPortletCats(), objKey) as IPSAppPortletCat;
  }

  protected allpsappviews: IPSAppView[] | null = null;

  getAllPSAppViews(): IPSAppView[] | null {
    if (this.allpsappviews == null) {
      this.allpsappviews = this.fillChildListModel(this.M.getAllPSAppViews, 'app.view.IPSAppView') as IPSAppView[];
    }
    return this.allpsappviews;
  }

  get allPSAppViews(): IPSAppView[] | null {
    return this.getAllPSAppViews();
  }

  findPSAppView(objKey: any): IPSAppView | null {
    return this.getPSModel5('app.view.IPSAppView', this.getAllPSAppViews(), objKey) as IPSAppView;
  }

  protected allpsdemainstates: IPSDEMainState[] | null = null;

  getAllPSDEMainStates(): IPSDEMainState[] | null {
    if (this.allpsdemainstates == null) {
      this.allpsdemainstates = this.fillChildListModel(this.M.getAllPSDEMainStates, 'dataentity.mainstate.IPSDEMainState') as IPSDEMainState[];
    }
    return this.allpsdemainstates;
  }

  get allPSDEMainStates(): IPSDEMainState[] | null {
    return this.getAllPSDEMainStates();
  }

  findPSDEMainState(objKey: any): IPSDEMainState | null {
    return this.getPSModel5('dataentity.mainstate.IPSDEMainState', this.getAllPSDEMainStates(), objKey) as IPSDEMainState;
  }

  protected allpsdeopprivs: IPSDEOPPriv[] | null = null;

  getAllPSDEOPPrivs(): IPSDEOPPriv[] | null {
    if (this.allpsdeopprivs == null) {
      this.allpsdeopprivs = this.fillChildListModel(this.M.getAllPSDEOPPrivs, 'dataentity.priv.IPSDEOPPriv') as IPSDEOPPriv[];
    }
    return this.allpsdeopprivs;
  }

  get allPSDEOPPrivs(): IPSDEOPPriv[] | null {
    return this.getAllPSDEOPPrivs();
  }

  findPSDEOPPriv(objKey: any): IPSDEOPPriv | null {
    return this.getPSModel5('dataentity.priv.IPSDEOPPriv', this.getAllPSDEOPPrivs(), objKey) as IPSDEOPPriv;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get codeName2(): string {
    return this.M.codeName2;
  }

  get dEAPICodeName(): string {
    return this.M.dEAPICodeName;
  }

  get dEAPICodeName2(): string {
    return this.M.dEAPICodeName2;
  }

  get dEAPITag(): string {
    return this.M.dEAPITag;
  }

  get dEFGroupMode(): 'REPLACE' | 'OVERWRITE' | 'EXCLUDE' {
    return this.M.dEFGroupMode;
  }

  get dataAccCtrlArch(): 1 | 2 {
    return this.M.dataAccCtrlArch;
  }

  get dataAccCtrlMode(): 0 | 1 | 2 | 3 {
    return this.M.dataAccCtrlMode;
  }

  protected datatypepsappdefield: IPSAppDEField | null = null;

  getDataTypePSAppDEField(): IPSAppDEField | null {
    if (this.datatypepsappdefield != null) return this.datatypepsappdefield;
    const value = this.M.getDataTypePSAppDEField;
    if (value == null) {
      return null;
    }
    this.datatypepsappdefield = this.findPSAppDEField(value);
    return this.datatypepsappdefield;
  }

  get dataTypePSAppDEField(): IPSAppDEField | null {
    return this.getDataTypePSAppDEField();
  }

  getDataTypePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getDataTypePSAppDEField();
    if (value == null) {
      throw new Error('未指定数据类型应用实体属性');
    }
    return value;
  }

  protected defaultpsappdedataexport: IPSAppDEDataExport | null = null;

  getDefaultPSAppDEDataExport(): IPSAppDEDataExport | null {
    if (this.defaultpsappdedataexport != null) return this.defaultpsappdedataexport;
    const value = this.M.getDefaultPSAppDEDataExport;
    if (value == null) {
      return null;
    }
    this.defaultpsappdedataexport = this.findPSAppDEDataExport(value);
    return this.defaultpsappdedataexport;
  }

  get defaultPSAppDEDataExport(): IPSAppDEDataExport | null {
    return this.getDefaultPSAppDEDataExport();
  }

  getDefaultPSAppDEDataExportMust(): IPSAppDEDataExport {
    const value = this.getDefaultPSAppDEDataExport();
    if (value == null) {
      throw new Error('未指定默认实体数据导入');
    }
    return value;
  }

  protected defaultpsappdedataimport: IPSAppDEDataImport | null = null;

  getDefaultPSAppDEDataImport(): IPSAppDEDataImport | null {
    if (this.defaultpsappdedataimport != null) return this.defaultpsappdedataimport;
    const value = this.M.getDefaultPSAppDEDataImport;
    if (value == null) {
      return null;
    }
    this.defaultpsappdedataimport = this.findPSAppDEDataImport(value);
    return this.defaultpsappdedataimport;
  }

  get defaultPSAppDEDataImport(): IPSAppDEDataImport | null {
    return this.getDefaultPSAppDEDataImport();
  }

  getDefaultPSAppDEDataImportMust(): IPSAppDEDataImport {
    const value = this.getDefaultPSAppDEDataImport();
    if (value == null) {
      throw new Error('未指定默认实体数据导入');
    }
    return value;
  }

  protected defaultpsappdeprint: IPSAppDEPrint | null = null;

  getDefaultPSAppDEPrint(): IPSAppDEPrint | null {
    if (this.defaultpsappdeprint != null) return this.defaultpsappdeprint;
    const value = this.M.getDefaultPSAppDEPrint;
    if (value == null) {
      return null;
    }
    this.defaultpsappdeprint = this.findPSAppDEPrint(value);
    return this.defaultpsappdeprint;
  }

  get defaultPSAppDEPrint(): IPSAppDEPrint | null {
    return this.getDefaultPSAppDEPrint();
  }

  getDefaultPSAppDEPrintMust(): IPSAppDEPrint {
    const value = this.getDefaultPSAppDEPrint();
    if (value == null) {
      throw new Error('未指定默认实体打印');
    }
    return value;
  }

  get dynaInstTag(): string {
    return this.M.dynaInstTag;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get enableUIActions(): 1 | 2 | 4 {
    return this.M.enableUIActions;
  }

  protected formtypepsappdefield: IPSAppDEField | null = null;

  getFormTypePSAppDEField(): IPSAppDEField | null {
    if (this.formtypepsappdefield != null) return this.formtypepsappdefield;
    const value = this.M.getFormTypePSAppDEField;
    if (value == null) {
      return null;
    }
    this.formtypepsappdefield = this.findPSAppDEField(value);
    return this.formtypepsappdefield;
  }

  get formTypePSAppDEField(): IPSAppDEField | null {
    return this.getFormTypePSAppDEField();
  }

  getFormTypePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getFormTypePSAppDEField();
    if (value == null) {
      throw new Error('未指定表单类型应用实体属性');
    }
    return value;
  }

  protected indextypepsappdefield: IPSAppDEField | null = null;

  getIndexTypePSAppDEField(): IPSAppDEField | null {
    if (this.indextypepsappdefield != null) return this.indextypepsappdefield;
    const value = this.M.getIndexTypePSAppDEField;
    if (value == null) {
      return null;
    }
    this.indextypepsappdefield = this.findPSAppDEField(value);
    return this.indextypepsappdefield;
  }

  get indexTypePSAppDEField(): IPSAppDEField | null {
    return this.getIndexTypePSAppDEField();
  }

  getIndexTypePSAppDEFieldMust(): IPSAppDEField {
    const value = this.getIndexTypePSAppDEField();
    if (value == null) {
      throw new Error('未指定索引类型应用实体属性');
    }
    return value;
  }

  protected keypsappdefield: IPSAppDEField | null = null;

  getKeyPSAppDEField(): IPSAppDEField | null {
    if (this.keypsappdefield != null) return this.keypsappdefield;
    const value = this.M.getKeyPSAppDEField;
    if (value == null) {
      return null;
    }
    this.keypsappdefield = this.findPSAppDEField(value);
    return this.keypsappdefield;
  }

  get keyPSAppDEField(): IPSAppDEField | null {
    return this.getKeyPSAppDEField();
  }

  getKeyPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getKeyPSAppDEField();
    if (value == null) {
      throw new Error('未指定主键属性');
    }
    return value;
  }

  protected lnpslanguageres: IPSLanguageRes | null = null;

  getLNPSLanguageRes(): IPSLanguageRes | null {
    if (this.lnpslanguageres != null) return this.lnpslanguageres;
    const value = this.M.getLNPSLanguageRes;
    if (value == null) {
      return null;
    }
    this.lnpslanguageres = this.getPSModel4('res.IPSLanguageRes', value, 'getLNPSLanguageRes') as IPSLanguageRes;
    return this.lnpslanguageres;
  }

  get lNPSLanguageRes(): IPSLanguageRes | null {
    return this.getLNPSLanguageRes();
  }

  getLNPSLanguageResMust(): IPSLanguageRes {
    const value = this.getLNPSLanguageRes();
    if (value == null) {
      throw new Error('未指定逻辑名称语言资源');
    }
    return value;
  }

  get logicName(): string {
    return this.M.logicName;
  }

  protected mainstatepsappdefields: IPSAppDEField[] | null = null;

  getMainStatePSAppDEFields(): IPSAppDEField[] | null {
    if (this.mainstatepsappdefields == null) {
      const value = this.M.getMainStatePSAppDEFields;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: IPSAppDEField[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        const item = this.findPSAppDEField(arrayNode[i]);
        if (item != null) {
          list.push(item);
        }
      }
      this.mainstatepsappdefields = list;
    }
    return this.mainstatepsappdefields.length == 0 ? null : this.mainstatepsappdefields;
  }

  get mainStatePSAppDEFields(): IPSAppDEField[] | null {
    return this.getMainStatePSAppDEFields();
  }

  findMainStatePSAppDEField(objKey: any): IPSAppDEField | null {
    return this.getPSModel5('app.dataentity.IPSAppDEField', this.getMainStatePSAppDEFields(), objKey) as IPSAppDEField;
  }

  protected majorpsappdefield: IPSAppDEField | null = null;

  getMajorPSAppDEField(): IPSAppDEField | null {
    if (this.majorpsappdefield != null) return this.majorpsappdefield;
    const value = this.M.getMajorPSAppDEField;
    if (value == null) {
      return null;
    }
    this.majorpsappdefield = this.findPSAppDEField(value);
    return this.majorpsappdefield;
  }

  get majorPSAppDEField(): IPSAppDEField | null {
    return this.getMajorPSAppDEField();
  }

  getMajorPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getMajorPSAppDEField();
    if (value == null) {
      throw new Error('未指定主信息属性');
    }
    return value;
  }

  get memo(): string {
    return this.M.memo;
  }

  protected minorpsappderss: IPSAppDERS[] | null = null;

  getMinorPSAppDERSs(): IPSAppDERS[] | null {
    if (this.minorpsappderss == null) {
      this.minorpsappderss = this.fillChildListModel(this.M.getMinorPSAppDERSs, 'app.dataentity.IPSAppDERS') as IPSAppDERS[];
    }
    return this.minorpsappderss;
  }

  get minorPSAppDERSs(): IPSAppDERS[] | null {
    return this.getMinorPSAppDERSs();
  }

  findMinorPSAppDERS(objKey: any): IPSAppDERS | null {
    return this.getPSModel5('app.dataentity.IPSAppDERS', this.getMinorPSAppDERSs(), objKey) as IPSAppDERS;
  }

  get name(): string {
    return this.M.name;
  }

  protected orgidpsappdefield: IPSAppDEField | null = null;

  getOrgIdPSAppDEField(): IPSAppDEField | null {
    if (this.orgidpsappdefield != null) return this.orgidpsappdefield;
    const value = this.M.getOrgIdPSAppDEField;
    if (value == null) {
      return null;
    }
    this.orgidpsappdefield = this.findPSAppDEField(value);
    return this.orgidpsappdefield;
  }

  get orgIdPSAppDEField(): IPSAppDEField | null {
    return this.getOrgIdPSAppDEField();
  }

  getOrgIdPSAppDEFieldMust(): IPSAppDEField {
    const value = this.getOrgIdPSAppDEField();
    if (value == null) {
      throw new Error('未指定组织标识应用实体属性');
    }
    return value;
  }

  protected psappmodule: IPSAppModule | null = null;

  getPSAppModule(): IPSAppModule | null {
    if (this.psappmodule != null) return this.psappmodule;
    const value = this.M.getPSAppModule;
    if (value == null) {
      return null;
    }
    const ipsapplication = this.getParentPSModelObject('app.IPSApplication') as IPSApplication;
    if (ipsapplication != null) {
      this.psappmodule = ipsapplication.findPSAppModule(value);
    }
    return this.psappmodule;
  }

  get psAppModule(): IPSAppModule | null {
    return this.getPSAppModule();
  }

  getPSAppModuleMust(): IPSAppModule {
    const value = this.getPSAppModule();
    if (value == null) {
      throw new Error('未指定应用模块');
    }
    return value;
  }

  get psDEName(): string {
    return this.M.getPSDEName;
  }

  getPSDEName(): string {
    return this.M.getPSDEName;
  }

  protected psder1n: IPSDER1N | null = null;

  getPSDER1N(): IPSDER1N | null {
    if (this.psder1n != null) return this.psder1n;
    const value = this.M.getPSDER1N;
    if (value == null) {
      return null;
    }
    this.psder1n = this.getPSModel4('dataentity.der.IPSDER1N', value, 'getPSDER1N') as IPSDER1N;
    return this.psder1n;
  }

  get psDER1N(): IPSDER1N | null {
    return this.getPSDER1N();
  }

  getPSDER1NMust(): IPSDER1N {
    const value = this.getPSDER1N();
    if (value == null) {
      throw new Error('未指定控制实体关系');
    }
    return value;
  }

  protected psdeserviceapi: IPSDEServiceAPI | null = null;

  getPSDEServiceAPI(): IPSDEServiceAPI | null {
    if (this.psdeserviceapi != null) return this.psdeserviceapi;
    const value = this.M.getPSDEServiceAPI;
    if (value == null) {
      return null;
    }
    this.psdeserviceapi = this.getPSSysServiceAPIMust().findPSDEServiceAPI(value);
    return this.psdeserviceapi;
  }

  get psDEServiceAPI(): IPSDEServiceAPI | null {
    return this.getPSDEServiceAPI();
  }

  getPSDEServiceAPIMust(): IPSDEServiceAPI {
    const value = this.getPSDEServiceAPI();
    if (value == null) {
      throw new Error('未指定实体服务接口');
    }
    return value;
  }

  protected psdataentity: IPSDataEntity | null = null;

  getPSDataEntity(): IPSDataEntity | null {
    if (this.psdataentity != null) return this.psdataentity;
    const value = this.M.getPSDataEntity;
    if (value == null) {
      return null;
    }
    this.psdataentity = this.getPSModel4('dataentity.IPSDataEntity', value, 'getPSDataEntity') as IPSDataEntity;
    return this.psdataentity;
  }

  get psDataEntity(): IPSDataEntity | null {
    return this.getPSDataEntity();
  }

  getPSDataEntityMust(): IPSDataEntity {
    const value = this.getPSDataEntity();
    if (value == null) {
      throw new Error('未指定实体对象');
    }
    return value;
  }

  protected pssysimage: IPSSysImage | null = null;

  getPSSysImage(): IPSSysImage | null {
    if (this.pssysimage != null) return this.pssysimage;
    const value = this.M.getPSSysImage;
    if (value == null) {
      return null;
    }
    this.pssysimage = this.getPSModel4('res.IPSSysImage', value, 'getPSSysImage') as IPSSysImage;
    return this.pssysimage;
  }

  get psSysImage(): IPSSysImage | null {
    return this.getPSSysImage();
  }

  getPSSysImageMust(): IPSSysImage {
    const value = this.getPSSysImage();
    if (value == null) {
      throw new Error('未指定系统图片资源');
    }
    return value;
  }

  protected pssyssfplugin: IPSSysSFPlugin | null = null;

  getPSSysSFPlugin(): IPSSysSFPlugin | null {
    if (this.pssyssfplugin != null) return this.pssyssfplugin;
    const value = this.M.getPSSysSFPlugin;
    if (value == null) {
      return null;
    }
    this.pssyssfplugin = this.getPSModel4('res.IPSSysSFPlugin', value, 'getPSSysSFPlugin') as IPSSysSFPlugin;
    return this.pssyssfplugin;
  }

  get psSysSFPlugin(): IPSSysSFPlugin | null {
    return this.getPSSysSFPlugin();
  }

  getPSSysSFPluginMust(): IPSSysSFPlugin {
    const value = this.getPSSysSFPlugin();
    if (value == null) {
      throw new Error('未指定后端扩展插件');
    }
    return value;
  }

  protected pssysserviceapi: IPSSysServiceAPI | null = null;

  getPSSysServiceAPI(): IPSSysServiceAPI | null {
    if (this.pssysserviceapi != null) return this.pssysserviceapi;
    const value = this.M.getPSSysServiceAPI;
    if (value == null) {
      return null;
    }
    this.pssysserviceapi = this.getPSModel4('service.IPSSysServiceAPI', value, 'getPSSysServiceAPI') as IPSSysServiceAPI;
    return this.pssysserviceapi;
  }

  get psSysServiceAPI(): IPSSysServiceAPI | null {
    return this.getPSSysServiceAPI();
  }

  getPSSysServiceAPIMust(): IPSSysServiceAPI {
    const value = this.getPSSysServiceAPI();
    if (value == null) {
      throw new Error('未指定服务接口');
    }
    return value;
  }

  protected quicksearchpsappdefields: IPSAppDEField[] | null = null;

  getQuickSearchPSAppDEFields(): IPSAppDEField[] | null {
    if (this.quicksearchpsappdefields == null) {
      this.quicksearchpsappdefields = this.fillChildListModel(this.M.getQuickSearchPSAppDEFields, 'app.dataentity.IPSAppDEField') as IPSAppDEField[];
    }
    return this.quicksearchpsappdefields;
  }

  get quickSearchPSAppDEFields(): IPSAppDEField[] | null {
    return this.getQuickSearchPSAppDEFields();
  }

  findQuickSearchPSAppDEField(objKey: any): IPSAppDEField | null {
    return this.getPSModel5('app.dataentity.IPSAppDEField', this.getQuickSearchPSAppDEFields(), objKey) as IPSAppDEField;
  }

  protected requestpaths: string[] | null = null;

  getRequestPaths(): string[] | null {
    if (this.requestpaths == null) {
      const value = this.M.requestPaths;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.requestpaths = list;
    }
    return this.requestpaths;
  }

  get requestPaths(): string[] | null {
    return this.getRequestPaths();
  }

  get storageMode(): 0 | 1 | 3 | 4 {
    return this.M.storageMode;
  }

  get sysAPITag(): string {
    return this.M.sysAPITag;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get defaultMode(): boolean {
    return this.M.defaultMode;
  }

  get enableDEMainState(): boolean {
    return this.M.enableDEMainState != null ? this.M.enableDEMainState : false;
  }

  get enableFilterActions(): boolean {
    return this.M.enableFilterActions;
  }

  get enableTempData(): boolean {
    return this.M.enableTempData != null ? this.M.enableTempData : false;
  }

  get enableUICreate(): boolean {
    return this.M.enableUICreate;
  }

  get enableUIModify(): boolean {
    return this.M.enableUIModify;
  }

  get enableUIRemove(): boolean {
    return this.M.enableUIRemove;
  }

  get enableWFActions(): boolean {
    return this.M.enableWFActions;
  }

  get major(): boolean {
    return this.M.major;
  }

  get cls(): string {
    return 'PSAppDataEntityImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'app.dataentity.IPSAppDataEntity' || cls == 'app.mob.IPSAppLocalDE') return true;
    return super.instanceof(cls);
  }
}
